import request from "../config/request.js";
import host from "../config/host";

// -------------------  预警列表  --------------------------

const getEarlywarningList = function (params, callback) {
  request.postData(host.pcHostUrl + "/wx/alarmRecord/list", params, callback);
};

const getEarlywarningDetail = function (id, callback) {
  request.getData(`${host.pcHostUrl}/wx/alarmRecord/detail/${id}`, callback);
};
const getEarlywarningDetailById = function (id, callback) {
  request.postData(`${host.pcHostUrl}/wx/alarmRecord/getById/${id}`, {}, callback);
};

const putEarlywarningStatus = function (data, success, error) {
  request.postData(host.pcHostUrl + "/wx/alarmRecord/handle", data, success, error);
};

const getAlarmSceneData = function (data, success, error) {
  request.postData(host.pcHostUrl + "/wx/alarmRecord/getAlarmData", data, success, error);
};

export default {
  getEarlywarningList,
  getEarlywarningDetail,
  putEarlywarningStatus,
  getAlarmSceneData,
  getEarlywarningDetailById,
};
